package org.rkuk.kasutil.test.framework 
{
	/**
	 * ...
	 * @author rkuk
	 */
	public class TestCase 
	{
		private var testClass_:Class;
		private var testObject_:Object;
		private var setUp_:TestMethod;
		private var testMethod_:TestMethod;
		private var tearDown_:TestMethod;
		
		public function TestCase(testClass:Class,setUp:TestMethod,testMethod:TestMethod,tearDown:TestMethod) 
		{
			testClass_ = testClass;
			setUp_ = setUp;
			testMethod_ = testMethod;
			tearDown_ = tearDown;
		}
		
		public function get testClass():Class 
		{
			return testClass_;
		}
		
		public function get testObject():Object
		{
			if (testObject_ == null)
				testObject_ = createTestObject();
				
			return testObject_;
		}
		
		protected function createTestObject():Object 
		{
			return new testClass_();
		}
		
		public function get setUp():TestMethod 
		{
			return setUp_;
		}
		
		public function get testMethod():TestMethod 
		{
			return testMethod_;
		}
		
		public function get tearDown():TestMethod 
		{
			return tearDown_;
		}
		
		public function destroyTestObject():void
		{
			testObject_ = null;
		}
	}
}